<div class="row">
	<div class="col-md-12">
		<div class="col-md-12 table-filter">
			<div class="col-md-4 col-md-offset-8">
				<input type="text" class="form-control" ng-model="filterQuery" id="filterTable" placeholder="Quick filter">
			</div>
		</div>
	</div>
</div>
<table class="table table-striped table-hover">
	<thead>
		<tr>
			<th>Name</th><th class="text-center">Instance Id</th><th class="text-center">Execution Id</th><th>Job Start Time</th>
			<th class="text-center">Step Executions Count</th><th>Status</th><th colspan="3" class="text-center">Actions</th>
		</tr>
	</thead>
	<tbody>
		<tr dir-paginate="item in pageable.items | itemsPerPage: pageable.pageSize | filter:filterQuery" total-items="pageable.total"
		    ng-show="!item.inactive">
			<td>{{item.name}}&nbsp;<span xd-deployment-status="item"></span></td>
            <td class="text-center">{{item.jobExecution.jobInstance.id}}</td>
            <td class="text-center">{{item.jobExecution.id}}</td>
			<td xd-date-time="{{item.jobExecution.startTime}}"></td>
			<td class="text-center">{{item.stepExecutionCount}}</td>
			<td ng-class="{'text-success': item.jobExecution.status === 'COMPLETED', 'text-danger': item.jobExecution.status === 'FAILED'}">{{item.jobExecution.status}}</td>
            <td class="action-column"><button ng-disabled="!item.restartable" type="button" class="btn btn-default" ng-click="restartJob(item)" title="Restart Job Execution">
                <span class="glyphicon glyphicon-retweet"></span></button></td>
            <td class="action-column">
                <button ng-disabled="!item.stoppable" type="button" class="btn btn-default" ng-click="stopJob(item)" title="Stop Job Execution">
                <span class="glyphicon glyphicon-stop"></span></button>
            </td>
            <td class="action-column"><button type="button" class="btn btn-default" ng-click="viewJobExecutionDetails(item)" title="Details"><span class="glyphicon glyphicon-search"></span></button></td>
		</tr>
	</tbody>
</table>
<dir-pagination-controls template-url="scripts/directives/dirPagination.tpl.html"
                         on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
